// ignore_for_file: file_names, unnecessary_question_mark, unnecessary_this, slash_for_doc_comments

import 'package:mybase/base/tool/empty/FFEmpty.dart';

/**扩展List，安全操作*/
extension FFListExt on List {
  /**安全取值 */
  dynamic safeValue<T>(int? index) {
    if (index == null) return null;
    if (FFEmpty.listIsEmpty(this)) return null;
    if (index < 0 || index >= this.length) return null;

    dynamic tmp = this[index];
    if (tmp is T) {
      return tmp;
    }
    return null;
  }
}
